NDK_PATH=/home/edgarzhou/resource/android-ndk-r21e
CLANG = ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi30-clang 
CROSS_COMPILE=/home/edgarzhou/w/gcc_linaro/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
ARCH = arm64
CC = ${CROSS_COMPILE}gcc
LD = ${CROSS_COMPILE}ld
DEPS_DIR_PATH=/home/edgarzhou/work/gitee/libbpf-bootstrap-for-android/deps
BPFTOOL := bpftool

KERNEL_SRC_PATH := ${HOME}/work/linux/kernel-4.14/
LIBBPF_INSTALL_PATH := ${yt_srctree}/install/new_libbpf/usr

BPFTOOLS = ${KERNEL_SRC_PATH}/samples/bpf
BPFLOADER = $(BPFTOOLS)/bpf_load.c

# CCINCLUDE += -I${KERNEL_SRC_PATH}/tools/testing/selftests -I${KERNEL_SRC_PATH}/usr/include -I${LIBBPF_INSTALL_PATH}/include
CCINCLUDE += -I${LIBBPF_INSTALL_PATH}/include

CCFLAGS += $(shell grep -q "define HAVE_ATTR_TEST 1" ${KERNEL_SRC_PATH}/tools/perf/perf-sys.h \
                  && echo "-DHAVE_ATTR_TEST=0")
CCFLAGS += -g -O2 -D__TARGET_ARCH_$(ARCH)
CLANGFLAGS := -g -O2 -D__TARGET_ARCH_$(ARCH)

# LOADINCLUDE += -I${KERNEL_SRC_PATH}/samples/bpf
# LOADINCLUDE += -I${KERNEL_SRC_PATH}/tools/lib
# LOADINCLUDE += -I${KERNEL_SRC_PATH}/tools/perf
# LOADINCLUDE += -I${KERNEL_SRC_PATH}/tools/include
LOADINCLUDE += -I${DEPS_DIR_PATH}/libelf-aarch64/usr/include 
LOADINCLUDE += -I${DEPS_DIR_PATH}/zlib-1.2.10 
LOADINCLUDE += -I${LIBBPF_INSTALL_PATH}/include
LOADINCLUDE += -I${KERNEL_SRC_PATH}/usr/include 

liba_path = ${LIBBPF_INSTALL_PATH}/lib64/libbpf.a ${DEPS_DIR_PATH}/libelf-aarch64/usr/lib/libelf.a ${DEPS_DIR_PATH}/zlib-1.2.10/libz.a
